home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Comms Spectacular / AppleTalk Remote Access / ara-various-scripts folder / MicroCom MacModem V.32 / MicroCom MacModem V.32
Encoding:
Text File  |  1991-09-04  |  3.2 KB  |  211 lines  |  [mlts/slnk]

  1. ! "Microcom QX - 6/28/91"
  2. @ORIGINATE
  3. @ANSWER
  4. !
  5. @LABEL 1
  6. serreset 9600, 0, 8, 1
  7. !
  8. ! first sync up the modem
  9. !
  10. matchclr
  11. matchstr 1 3 "A"
  12. settries 0
  13. @LABEL 2
  14. write "A"
  15. matchread 10
  16. inctries
  17. iftries 4 3
  18. jump 2
  19. @LABEL 3
  20. matchclr
  21. settries 0
  22. matchstr 1 4 "OK\13\10"
  23. write "T\13"
  24. matchread 30
  25. !
  26. !    Now, recall the modems factory configuration
  27. !
  28. @LABEL 4
  29. matchstr 1 5 "OK\13\10"
  30. write "AT&F\13"
  31. matchread 30
  32. inctries
  33. iftries 2 59
  34. ! Modem is not responding, reset
  35. DTRClear
  36. pause 5
  37. DTRSet
  38. jump 4
  39. !
  40. ! Next, Set up the configuration:
  41. ! Echo off, serial port flow control off, modem flow control off
  42. !
  43. @LABEL 5
  44. matchstr 1 6 "OK\13\10"
  45. write "ATE0\\Q0\\G0\13"
  46. matchread 30
  47. jump 59
  48. !
  49. ! Connect in direct mode, no mnp, no speed conversion; go on hook and reset when DTR drops
  50. !
  51. @LABEL 6
  52. matchstr 1 7 "OK\13\10"
  53. write "AT\\N1&D3\13"
  54. matchread 30
  55. jump 59
  56. !
  57. ! Set up the speaker: If speaker flag is "1", jump to 8;  else turn off speaker
  58. @LABEL 7
  59. ifstr 2 8 "1"
  60. matchstr 1 8 "OK\13\10"
  61. write "ATM0\13"
  62. matchread 30
  63. jump 59
  64. !
  65. ! The modem is ready.  So enable answering, or originate a call
  66. !
  67. @LABEL 8
  68. ifANSWER 30
  69. note "Dialing ^1" 3
  70. write "ATS0=0DT^1\13"
  71. !
  72. @LABEL 9
  73. matchstr 1 11 "CONNECT 1200\13\10"
  74. matchstr 2 12 "CONNECT 2400\13\10"
  75. matchstr 3 13 "CONNECT 4800\13\10"
  76. matchstr 4 14 "CONNECT 9600\13\10"
  77. matchstr 5 50 "NO CARRIER\13\10"
  78. matchstr 6 50 "ERROR\13\10"
  79. matchstr 7 52 "NO DIALTONE\13\10"
  80. matchstr 8 53 "BUSY\13\10"
  81. matchstr 9 54 "NO ANSWER\13\10"
  82. matchread 700
  83. jump 59
  84. !
  85. @LABEL 11
  86. note "Communicating at 1200 bps." 2
  87. serreset 1200, 0, 8, 1
  88. jump 15
  89. !
  90. @LABEL 12
  91. note "Communicating at 2400 bps." 2
  92. serreset 2400, 0, 8, 1
  93. jump 15
  94. !
  95. @LABEL 13
  96. note "Communicating at 4800 bps." 2
  97. serreset 4800, 0, 8, 1
  98. jump 15
  99. !
  100. @LABEL 14
  101. note "Communicating at 9600 bps." 2
  102. serreset 9600, 0, 8, 1
  103. !
  104. @LABEL 15
  105. ifANSWER 16
  106. pause 30
  107. @LABEL 16
  108. exit 0
  109. !
  110. ! @ANSWER
  111. ! Set up the modem to answer
  112. @LABEL 30
  113. write "ATS0=1\13"
  114. matchstr 1 31 "OK\13\10"
  115. matchread 30
  116. jump 59
  117. !
  118. @LABEL 31
  119. matchstr 1  32 "RING\13\10"
  120. matchstr 2  11 "CONNECT 1200\13\10"
  121. matchstr 3  12 "CONNECT 2400\13\10"
  122. matchstr 4  13 "CONNECT 4800\13\10"
  123. matchstr 5  14 "CONNECT 9600\13\10"
  124. matchstr 6  50 "NO CARRIER\13\10"
  125. matchstr 7  50 "ERROR\13\10"
  126. matchstr 8  52 "NO DIALTONE\13\10"
  127. matchstr 9  53 "BUSY\13\10"
  128. matchstr 10 54 "NO ANSWER\13\10"
  129. matchread 700
  130. jump 31
  131. !
  132. @LABEL 32
  133. userhook 1
  134. note "Answering phone…" 2
  135. jump 31
  136. !
  137. ! 50: error messages
  138. !
  139. @LABEL 50
  140. exit -6021
  141. !
  142. @LABEL 52
  143. exit -6020
  144. !
  145. @LABEL 53
  146. exit -6022
  147. !
  148. @LABEL 54
  149. exit -6023
  150. !
  151. @LABEL 59
  152. exit -6019
  153. !
  154. ! Hang up the modem
  155. !
  156. @HANGUP
  157. @LABEL 60
  158. settries 0
  159. @LABEL 61
  160. write "ATH\13"
  161. matchclr
  162. matchstr 1 63 "OK\13\10"
  163. matchstr 2 63 "NO CARRIER\13\10"
  164. matchstr 3 63 "ERROR\13\10"
  165. matchread 30
  166. inctries
  167. iftries 3 63
  168. ! no response, try escape sequence
  169. write "+++"
  170. matchclr
  171. matchstr 1 62 "OK\13\10"
  172. matchread 20
  173. !
  174. ! No response from modem, toggle DTR
  175. !
  176. DTRClear
  177. pause 5
  178. DTRSet
  179. jump 61
  180. !
  181. @LABEL 62
  182. pause 5
  183. write "ATH\13"
  184. matchstr 1 63 "OK\13\10"
  185. matchstr 2 63 "NO CARRIER\13\10"
  186. matchstr 3 63 "ERROR\13\10"
  187. matchread 70
  188. jump 61
  189. !
  190. ! Recall factory settings
  191. !
  192. @LABEL 63
  193. pause 5
  194. matchclr
  195. matchstr 1 64 "OK\13\10"
  196. write "AT&F\13"
  197. matchread 30
  198. !
  199. ! Turn off auto answer
  200. !
  201. @LABEL 64
  202. write "ATS0=0\13"
  203. matchstr 1 65 "OK\13\10"
  204. matchread 30
  205. !
  206. ! Add delay to make sure other side of connection hangs up for call back.
  207. !
  208. @LABEL 65
  209. exit 0
  210.